package ProjectTeam39.Domains;
/**
 * Returns a patientInvoice string by reading doctorsOrders and printing an invoice with services 
 * provided and their respective prices.
 * 
 * @author SethEDubin
 *
 */
public class PatientInvoice {
	
	Appointment date;
	Doctor doctor;
	TreatmentRecord treatments; 
	String work, invoice, docOrders, instructions;
	Integer cost = 0;
	
	/**
	 * Constructor takes in a treatment record object 
	 * 
	 * @param treatments
	 */
	public PatientInvoice(TreatmentRecord treatments)
	{
		this.treatments = treatments;
	}
	
	/**
	 * Determines if doctors orders object contains strings and adds on to the invoice
	 * 
	 * @return invoice 
	 */
	public String listInvoice()
	{
		work = treatments.getDoctorsOrders().listLabWork();
		work = work.toLowerCase(); 
		
		docOrders = treatments.getDoctorsOrders().listFollowUp();
		docOrders = docOrders.toUpperCase();
		
		instructions = treatments.getDoctorsOrders().listInstructions();
		instructions = instructions.toUpperCase(); 
		
		boolean a = work.contains("base");
		if (a == true)
		{
			cost += 50;
			invoice += "\n" + " Office Visit Base:" + "\t" + "$50" ; 
		}
		
		boolean b = work.contains("phone");
		if (b == true)
		{
			cost += 35;
			invoice += "\n" + "Phone Consult:" + "\t" + "$35" ; 
		}
		
		boolean c = work.contains("annual");
		if (c == true)
		{
			cost += 75;
			invoice += "\n" + "Annual Physical:" + "\t" + "$75" ; 
		}
		
		boolean d = work.contains("flu");
		if (d == true)
		{
			cost += 25;
			invoice += "\n" + "Flu vaccine:" + "\t" + "$25" ; 
		}
		
		boolean e = work.contains("tetanus");
		if (e == true)
		{
			cost += 30;
			invoice += "\n" + "Tetanus vaccine:" + "\t" + "$30" ; 
		}
		
		boolean f = work.contains("mmr");
		if (f == true)
		{
			cost += 15;
			invoice += "\n" + "MMR vaccine:" + "\t" + "$15" ; 
		}
		
		boolean g = work.contains("hepatitis");
		if (g == true)
		{
			cost += 50;
			invoice += "\n" + "Hepatitis A vaccine:" + "\t" + "$50" ; 
		}
		
		boolean h = work.contains("steroid");
		if (h == true)
		{
			cost += 56;
			invoice += "\n" + "Steroid vaccine:" + "\t" + "$56" ; 
		}
		
		boolean i = work.contains("bun");
		if (i == true)
		{
			cost += 50;
			invoice += "\n" + "Urinalysis BUN:" + "\t" + "$50" ; 
		}
		
		boolean j = work.contains("drug");
		if (j == true)
		{
			cost += 25;
			invoice += "\n" + "Urinalysis Drug Test:" + "\t" + "$25" ; 
		}
		
		boolean k = work.contains("cbc");
		if (k == true)
		{
			cost += 75;
			invoice += "\n" + "CBC Labwork:" + "\t" + "$75" ; 
		}
		
		boolean l = work.contains("cholesterol");
		if (l == true)
		{
			cost += 40;
			invoice += "\n" + "Cholesterol Labwork:" + "\t" + "$40" ; 
		}
		
		boolean m = work.contains("hiv");
		if (m == true)
		{
			cost += 100;
			invoice += "\n" + "HIV Labwork:" + "\t" + "$100" ; 
		}
		
		boolean n = work.contains("glucose");
		if (n == true)
		{
			cost += 75;
			invoice += "\n" + "Glucose Labwork:" + "\t" + "$75" ; 
		}
		
		boolean o = work.contains("adrenal");
		if (o == true)
		{
			cost += 65;
			invoice += "\n" + "Adrenal Labwork:" + "\t" + "$65" ; 
		}
		
		boolean p = work.contains("ekg");
		if (p == true)
		{
			cost += 100;
			invoice += "\n" + "EKG Labwork:" + "\t" + "$100" ; 
		}
		
		boolean q = work.contains("mri");
		if (q == true)
		{
			cost += 1000;
			invoice += "\n" + "MRI Labwork:" + "\t" + "$1000" ; 
		}
		
		invoice += "\n" + "Total Cost: " + "$" + cost.toString() + ".00";
		
		invoice += "\n" + "Follow-Up Orders" + docOrders; 
		
		invoice += "\n" + "Other Instructions" + instructions; 
		
		invoice += "\n"+"\n"+"\n";
		return invoice;
	
	}
	
	
	

}
